/**********************************************************************
 Copyright (C) 2010 Teppo Eeva

 This file is part of Arithmetic Game.
 For more information, see <http://code.google.com/p/arithmetic-game/>

 Arithmetic Game is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Arithmetic Game is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Arithmetic Game.  If not, see <http://www.gnu.org/licenses/>.
 **********************************************************************/

#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <QDialog>
#include <QSettings>
#include <QLocale>
#include "arithgame.h"

namespace Ui {
    class SettingsDialog;
}


class SettingsDialog : public QDialog {
    Q_OBJECT
public:
    SettingsDialog(QWidget *parent = 0);
    ~SettingsDialog();

public:

    QLocale::Language gameLanguage();

    ArithDiffLevel difficultyLevel();

    bool isSoundsEnabled();

protected:
    void changeEvent(QEvent *e);

private Q_SLOTS:
    void storeSettings();
    void initSettings();

Q_SIGNALS:
    // Emited when audio effect are enabled or disabled
    void audioEffectOptionUpdated(bool enabled);
    void difftLevelOptionUpdated(ArithDiffLevel diffLevel);
    void languageOptionUpdated();

private:

    void localize(QLocale::Language lang);


private:
    Ui::SettingsDialog *ui;
    QSettings m_settings;
};

#endif // SETTINGSDIALOG_H
